// by Xeno
private ["_selection", "_control", "_selectedIndex", "_real_list", "_vlist"];

disableSerialization;

_selection = _this select 0;

_control = _selection select 0;
_selectedIndex = _selection select 1;

if (_selectedIndex == -1) exitWith {};
if (!d_canChangeGrassLayer) exitWith {(localize "MSG_DOM_GRASSDISALLOWED") call XfGlobalChat;};
_real_list = [50, 25, 12.5];
_vlist = [localize "MSG_DOM_GRASSNONE", localize "MSG_DOM_GRASSMEDIUM", localize "MSG_DOM_GRASSFULL"];
if (d_grasslayer_index != _selectedIndex) then {
	d_grasslayer_index = _selectedIndex;
	setTerrainGrid (_real_list select d_grasslayer_index);
	(format [localize "MSG_DOM_GRASSSETTO",_vlist select d_grasslayer_index]) call XfGlobalChat;
};